/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.dc.tool;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author Administrator
 */
public class Tools {

    private static Boolean debug = true;

    public static void OutLog(String log) {
        if (debug) {
            System.out.println(getDateEN() + ":" + log);
        }
    }

    public static String getDateCN() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
        String date = format.format(new Date(System.currentTimeMillis()));
        return date;
    }

    public static String getDateEN() {
        SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date1 = format1.format(new Date(System.currentTimeMillis()));
        return date1;// 2012-10-03 23:41:31
    }

    public static String getDate() {
        SimpleDateFormat format = new SimpleDateFormat("HH:mm");
        String date = format.format(new Date(System.currentTimeMillis()));
        return date;
    }

    public static boolean IsNull(String data) {
        if (data != null && !data.trim().equalsIgnoreCase("") && !data.trim().equalsIgnoreCase("null")) {
            return false;
        }
        return true;
    }
}
